<template>
  <div class="technic-item">
    <div class="content">
      <div class="title van-multi-ellipsis--l2">
        {{ itemData.title }}
      </div>
      <div class="info">
        <div class="time">{{ itemData.created_at | formatTime }}</div>
        <div class="see">
          <i class="iconfont iconicon_liulanliang"></i>
          <span>{{ itemData.read }}</span>
        </div>
        <div class="zan">
          <i class="iconfont iconbtn_dianzan_small_nor actived"></i>
          <span>{{ itemData.star }}</span>
        </div>
      </div>
    </div>
    <div class="cover">
      <img :src="itemData.cover | addBaseUrl" alt="" />
    </div>
  </div>
</template>

<script>
import moment from 'moment'
export default {
  name: 'mm-technic-item',
  props: ['itemData'],
  filters: {
    addBaseUrl (url) {
      return process.env.VUE_APP_URL + url
    },
    formatTime (time) {
      return moment(time).format('YYYY年MM月DD日')
    }
  },
  computed: {},
  methods: {}
}
</script>

<style lang="less">
.technic-item {
  padding-bottom: 29px;
  display: flex;
  min-height: 67px;
  .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .title {
      font-size: 16px;
      font-weight: 500;
      color: @main-font-color;
    }
    .info {
      color: @minor-font-color;
      font-size: 12px;
      display: flex;
      margin-top: 10px;
      align-items: center;
      .time {
        flex: 1;
      }
      .iconfont {
        margin-right: 8px;
        font-size: 16px;
        line-height: 1;
      }
      .see {
        margin-right: 23px;
        display: flex;
        align-items: center;
      }
      .zan {
        display: flex;
        align-items: center;
      }
    }
  }
  .cover {
    width: 113px;
    height: 75px;
    margin-left: 16px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  // 高亮效果
  .iconfont.actived {
    color: @main-color;
  }
}
</style>
